package Task2;

public class Student extends person{


   private double no;
   private double scoreEn;
    private double scoreMath;
    private double scoreCh;


    public double getNo() {
        return no;
    }

    public void setNo(double no) {
        this.no = no;
    }

    public double getScoreEn() {
        return scoreEn;
    }

    public void setScoreEn(double scoreEn) {
        this.scoreEn = scoreEn;
    }

    public double getScoreMath() {
        return scoreMath;
    }

    public void setScoreMath(double scoreMath) {
        this.scoreMath = scoreMath;
    }

    public double getScoreCh() {
        return scoreCh;
    }

    public void setScoreCh(double scoreCh) {
        this.scoreCh = scoreCh;
    }

    public Student(String name, int age, boolean sex, double no, double scoreEn, double scoreMath, double scoreCh) {
        super();
        this.no = no;
        this.scoreEn = scoreEn; //英语成绩
        this.scoreMath = scoreMath;//数学成绩
        this.scoreCh = scoreCh;//语文成绩
    }

    public Student() {
        super();
    }


    @Override
    public String toString() {
        return "Student{" +
                "no=" + no +
                ", scoreEn=" + scoreEn +
                ", scoreMath=" + scoreMath +
                ", scoreCh=" + scoreCh +
                '}';
    }


    public double aver(){
        return (scoreCh+scoreEn+scoreMath)/3;

    }
    public double max(){
       return Math.max(Math.max(scoreEn,scoreMath),scoreCh);
   }
   public double min(){
       return Math.min(Math.min(scoreEn,scoreMath),scoreCh);
   }
}
